class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table "users", :force => true do |t|
      t.column :login,                     :string
      t.column :crypted_password,          :string, :limit => 40
      t.column :salt,                      :string, :limit => 40
      t.column :admin,                     :bool, :null => false
      t.column :created_at,                :datetime
      t.column :updated_at,                :datetime
      t.column :remember_token,            :string
      t.column :remember_token_expires_at, :datetime            
    end
    
    @user = User.new
    @user.login = "bjornakr"
    @user.password = "289qyrs"
    @user.password_confirmation = "289qyrs"
    @user.admin = true
    @user.save
    @user.errors.each_full do |e|
      puts e
    end

    #User.create({:login => "bjornakr", :crypted_password => "c0759f36958f44891fc39700041d6883efff44c9", :salt => "5dd287da8155640de3d54064a7565beb36117688", :admin => true})
  end

  def self.down
    drop_table "users"
  end
end
